//
//  DYURLSet.m
//  Pods
//
//  Created by LXF on 16/7/1.
//
//

#import "DYURLSet.h"

#define DELETE @"DELETE"
#define PATCH @"PATCH"
#define PUT @"PUT"
#define POST @"POST"
#define HEAD @"HEAD"
#define GET @"GET"

#undef URLInfo

#define URLInfo(propertyName,__method,__url) \
- (XXURLInfo *) propertyName {\
if (_ ##propertyName == nil) {\
_ ##propertyName = [[XXURLInfo alloc] init];\
_ ##propertyName.method = __method;\
_ ##propertyName.url = __url;\
}\
return _ ##propertyName;\
}

@implementation DYURLSet

+(instancetype)shared{
    static id instance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[self alloc]init];
        
    });
    return instance;
}

URLInfo(login, POST, @"/sc_sso/account/login.json");
URLInfo(mylist, GET, @"/sc/v2/home/mylist.json");
URLInfo(forget, PUT, @"/sc/account/f/password.json");
URLInfo(smsc, GET, @"/sc/v2/sms/{type}/{tel}.json")
URLInfo(loadProjectExcel, POST, @"/energy/mobile/sinoene/getProjectExcel.json");
URLInfo(loadReport, POST, @"/energy/mobile/sinoene/getProjectData.json");
URLInfo(regist, POST, @"/sc/v2/account/register.json");
URLInfo(feedback, POST, @"/sc/suggest.json");
URLInfo(changePassword, PUT, @"/sc/account/password.json");
URLInfo(changeNickName, PUT, @"/sc/v2/account/update.json");
URLInfo(getRCloud, GET, @"/sc/v2/rongCloud/getToken/{userId}.json");
URLInfo(loadRunDataAlarm, POST, @"/energy/mobile/Alarm/queryAlarm.json");
URLInfo(loadSystemAlarm, POST, @"/energy/mobile/Alarm/queryAlarm.json");
URLInfo(loadCommunicationAlarm, POST, @"/energy/mobile/Alarm/queryAlarm.json");
URLInfo(loadAllProjects, POST, @"/energy/mobile/Project/List.json");
URLInfo(loadReportDetail, POST, @"/energy/mobile/sinoene/getProjectData.json");
URLInfo(submitWorkorder, POST, @"/energy/mobile/Workorder/addWorkorder.json");
URLInfo(updateWorkorder, POST, @"/energy/mobile/Workorder/updateWorkorder.json");
URLInfo(loadWorkorder, POST, @"/energy/mobile/Workorder/queryWorkorder.json");
URLInfo(changeProjects, POST, @"/energy/mobile/Project/updateDefaultProject.json");
URLInfo(loadClickCheckData, POST, @"/energy/mobile/Workorder/queryWorkorder.json");

URLInfo(loadOpenDoorList, GET, @"/sc/v2/community/video/getOpenList.json");

@end
